#include<iostream>
#include<vector>
using namespace std;


vector<int> solve(int n, int m, vector<int>& a) {
	m %= n;
	if (m == 0) return a;
	reverse(a.begin(), a.end());
	reverse(a.begin(), a.begin() + m);
	reverse(a.begin() + m, a.end());
	return a;
}

int main()
{ 

	vector<int>a = { 1,2,3,4,5,6 };
	solve(6, 2, a);
	return 0;
}